<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>array maps test</title>
    <script src="../dist/global.js"></script>
  </head>
  <body>
    <script>
      const rawList = Array(10)
        .fill('')
        .map((item, index) => {
          return {
            id: index,
            name: `name ${index}`,
          };
        });

      const listMaps = arrayMaps.createMaps(rawList, 'id', 'name');
      console.log(listMaps.maps.id[5]);
      listMaps.push({
        id: 11,
        name: `name ${11}`,
      });

      const raw = listMaps.indexOf(listMaps[5], 0);
      // const i = listMaps.indexOf(11, 'id');
      const i = listMaps.indexOf('name 11', 'name');
      console.log('indexOf', i, raw);

      console.log(listMaps, listMaps.maps.id[6], listMaps.maps.name['name 11']);
    </script>
  </body>
</html>
